angular.module('starter.services', [])

.factory('datas', [function() {

    var rates = [
        { rate: 1, name: '刘工1', job: 'AM', per: 1291 },
        { rate: 2, name: '刘工2', job: 'AM', per: 1239 },
        { rate: 3, name: '刘工3', job: 'AM', per: 218 },
        { rate: 4, name: '刘工4', job: 'AM', per: 191 },
        { rate: 5, name: '刘工5', job: 'AM', per: 145 },
        { rate: 6, name: '刘工6', job: 'AM', per: 138 },
        { rate: 7, name: '刘工7', job: 'AM', per: 117 },
        { rate: 8, name: '刘工8', job: 'AM', per: 82 },
        { rate: 9, name: '刘工9', job: 'AM', per: 98 },
        { rate: 10, name: '刘工10', job: 'AM', per: 88 }
    ];

    // 时间  年  月
    var times = [{ id: 1, "year": 2016, "month": 8 },
        { id: 2, "year": 2016, "month": 9 },
        { id: 3, "year": 2016, "month": 10 }
    ];


    return {
        rates: rates,
        times: times
    };
}])

.factory('performances', [function() {
    var performances = [{
        id: 1,
        datas: [{ a2: 155, a3: 128.65, time: '2016年8月', month: '月度团队达成率' },
            { a2: 310, a3: 283.65, time: '2016年8,9月', month: '双月团队达成率' }
        ]
    }, {
        id: 2,
        datas: [{ a2: 155, a3: 155, time: '2016年9月', month: '月度团队达成率' },
            { a2: 355, a3: 380, time: '2016年9,10月', month: '双月团队达成率' }
        ]
    }, {
        id: 3,
        datas: [{ a2: 200, a3: 225, time: '2016年10月', month: '月度团队达成率' },
            { a2: 355, a3: 380, time: '2016年9,10月', month: '双月团队达成率' }
        ]
    }];

    return {
        get: function(id) {
            for (var i = 0; i < performances.length; i++) {
                if (performances[i].id == id) {
                    return performances[i].datas;
                }
            }
            return null;
        }
    };
}])

.factory('series', [function() {
    var series = [{
        id: 1,
        datas: [{
            id: 1,
            datas: [{
                name: "陈宏子",
                data: [
                    { x: 95, y: 95, z: 12, name: "陈宏子", country: "Belgium" }
                ]
            }, {
                name: "秦婷婷",
                data: [
                    { x: 86.5, y: 192.9, z: 12, name: "秦婷婷", country: "Germany" }
                ]
            }, {
                name: "折蓉蓉",
                data: [
                    { x: 96.8, y: 81.5, z: 12, name: "折蓉蓉", country: "Finland" }
                ]
            }, {
                name: "陈迪",
                data: [
                    { x: 87.4, y: 122.5, z: 12, name: "陈迪", country: "Netherlands" }
                ]
            }, {
                name: "傅双育",
                data: [
                    { x: 70.4, y: 182.5, z: 12, name: "傅双育", country: "Netherlands" }
                ]
            }, {
                name: "刘旭阳",
                data: [
                    { x: 93.4, y: 142.5, z: 12, name: "刘旭阳", country: "Netherlands" }
                ]
            }, {
                name: "崔丹",
                data: [
                    { x: 110.4, y: 122.5, z: 12, name: "崔丹", country: "Netherlands" }
                ]
            }, {
                name: "俞旸",
                data: [
                    { x: 98.4, y: 172.5, z: 12, name: "俞旸", country: "Netherlands" }
                ]
            }, {
                name: "黄彩萍",
                data: [
                    { x: 84.4, y: 102.5, z: 12, name: "黄彩萍", country: "Netherlands" }
                ]
            }, {
                name: "张力甦",
                data: [
                    { x: 120.4, y: 122.5, z: 12, name: "张力甦", country: "Netherlands" }
                ]
            }]
        }, {
            id: 2,
            datas: [{
                name: "陈宏子",
                data: [
                    { x: 85, y: 85, z: 12, name: "陈宏子", country: "Belgium" }
                ]
            }, {
                name: "秦婷婷",
                data: [
                    { x: 107.5, y: 87, z: 12, name: "秦婷婷", country: "Germany" }
                ]
            }, {
                name: "折蓉蓉",
                data: [
                    { x: 91.8, y: 91.5, z: 12, name: "折蓉蓉", country: "Finland" }
                ]
            }, {
                name: "陈迪",
                data: [
                    { x: 93.4, y: 130.5, z: 12, name: "陈迪", country: "Netherlands" }
                ]
            }, {
                name: "傅双育",
                data: [
                    { x: 94.4, y: 194.5, z: 12, name: "傅双育", country: "Netherlands" }
                ]
            }, {
                name: "刘旭阳",
                data: [
                    { x: 80.4, y: 172.5, z: 12, name: "刘旭阳", country: "Netherlands" }
                ]
            }, {
                name: "崔丹",
                data: [
                    { x: 99.4, y: 152.5, z: 12, name: "崔丹", country: "Netherlands" }
                ]
            }, {
                name: "俞旸",
                data: [
                    { x: 88.4, y: 122.5, z: 12, name: "俞旸", country: "Netherlands" }
                ]
            }, {
                name: "黄彩萍",
                data: [
                    { x: 90.4, y: 162.5, z: 12, name: "黄彩萍", country: "Netherlands" }
                ]
            }, {
                name: "张力甦",
                data: [
                    { x: 112.4, y: 142.5, z: 12, name: "张力甦", country: "Netherlands" }
                ]
            }]
        }, {
            id: 3,
            datas: [{
                name: "陈宏子",
                data: [
                    { x: 95, y: 95, z: 12, name: "陈宏子", country: "Belgium" }
                ]
            }, {
                name: "秦婷婷",
                data: [
                    { x: 100.5, y: 182.9, z: 12, name: "秦婷婷", country: "Germany" }
                ]
            }, {
                name: "折蓉蓉",
                data: [
                    { x: 94.8, y: 141.5, z: 12, name: "折蓉蓉", country: "Finland" }
                ]
            }, {
                name: "陈迪",
                data: [
                    { x: 82.4, y: 172.5, z: 12, name: "陈迪", country: "Netherlands" }
                ]
            }, {
                name: "傅双育",
                data: [
                    { x: 88.4, y: 162.5, z: 12, name: "傅双育", country: "Netherlands" }
                ]
            }, {
                name: "刘旭阳",
                data: [
                    { x: 97.4, y: 152.5, z: 12, name: "刘旭阳", country: "Netherlands" }
                ]
            }, {
                name: "崔丹",
                data: [
                    { x: 92.4, y: 182.5, z: 12, name: "崔丹", country: "Netherlands" }
                ]
            }, {
                name: "俞旸",
                data: [
                    { x: 90.4, y: 132.5, z: 12, name: "俞旸", country: "Netherlands" }
                ]
            }, {
                name: "黄彩萍",
                data: [
                    { x: 84.4, y: 122.5, z: 12, name: "黄彩萍", country: "Netherlands" }
                ]
            }, {
                name: "张力甦",
                data: [
                    { x: 88.4, y: 102.5, z: 12, name: "张力甦", country: "Netherlands" }
                ]
            }]
        }]
    }, {
        id: 2,
        datas: [{
            id: 1,
            datas: [{
                name: "陈宏子",
                data: [
                    { x: 95, y: 95, z: 12, name: "陈宏子", country: "Belgium" }
                ]
            }, {
                name: "秦婷婷",
                data: [
                    { x: 86.5, y: 132.9, z: 12, name: "秦婷婷", country: "Germany" }
                ]
            }, {
                name: "折蓉蓉",
                data: [
                    { x: 100.8, y: 91.5, z: 12, name: "折蓉蓉", country: "Finland" }
                ]
            }, {
                name: "陈迪",
                data: [
                    { x: 96.4, y: 182.5, z: 12, name: "陈迪", country: "Netherlands" }
                ]
            }, {
                name: "傅双育",
                data: [
                    { x: 88.4, y: 112.5, z: 12, name: "傅双育", country: "Netherlands" }
                ]
            }, {
                name: "刘旭阳",
                data: [
                    { x: 94.4, y: 162.5, z: 12, name: "刘旭阳", country: "Netherlands" }
                ]
            }, {
                name: "崔丹",
                data: [
                    { x: 100.4, y: 172.5, z: 12, name: "崔丹", country: "Netherlands" }
                ]
            }, {
                name: "俞旸",
                data: [
                    { x: 94.4, y: 122.5, z: 12, name: "俞旸", country: "Netherlands" }
                ]
            }, {
                name: "黄彩萍",
                data: [
                    { x: 97.4, y: 142.5, z: 12, name: "黄彩萍", country: "Netherlands" }
                ]
            }, {
                name: "张力甦",
                data: [
                    { x: 91.4, y: 112.5, z: 12, name: "张力甦", country: "Netherlands" }
                ]
            }]
        }, {
            id: 2,
            datas: [{
                name: "陈宏子",
                data: [
                    { x: 95, y: 95, z: 12, name: "陈宏子", country: "Belgium" }
                ]
            }, {
                name: "秦婷婷",
                data: [
                    { x: 89.5, y: 102.9, z: 12, name: "秦婷婷", country: "Germany" }
                ]
            }, {
                name: "折蓉蓉",
                data: [
                    { x: 81.8, y: 91.5, z: 12, name: "折蓉蓉", country: "Finland" }
                ]
            }, {
                name: "陈迪",
                data: [
                    { x: 95.4, y: 192.5, z: 12, name: "陈迪", country: "Netherlands" }
                ]
            }, {
                name: "傅双育",
                data: [
                    { x: 89.4, y: 142.5, z: 12, name: "傅双育", country: "Netherlands" }
                ]
            }, {
                name: "刘旭阳",
                data: [
                    { x: 90.4, y: 182.5, z: 12, name: "刘旭阳", country: "Netherlands" }
                ]
            }, {
                name: "崔丹",
                data: [
                    { x: 80.4, y: 132.5, z: 12, name: "崔丹", country: "Netherlands" }
                ]
            }, {
                name: "俞旸",
                data: [
                    { x: 98.4, y: 162.5, z: 12, name: "俞旸", country: "Netherlands" }
                ]
            }, {
                name: "黄彩萍",
                data: [
                    { x: 100.4, y: 132.5, z: 12, name: "黄彩萍", country: "Netherlands" }
                ]
            }, {
                name: "张力甦",
                data: [
                    { x: 110.4, y: 192.5, z: 12, name: "张力甦", country: "Netherlands" }
                ]
            }]
        }, {
            id: 3,
            datas: [{
                name: "陈宏子",
                data: [
                    { x: 95, y: 95, z: 12, name: "陈宏子", country: "Belgium" }
                ]
            }, {
                name: "秦婷婷",
                data: [
                    { x: 86.5, y: 192.9, z: 12, name: "秦婷婷", country: "Germany" }
                ]
            }, {
                name: "折蓉蓉",
                data: [
                    { x: 99.8, y: 152.5, z: 12, name: "折蓉蓉", country: "Finland" }
                ]
            }, {
                name: "陈迪",
                data: [
                    { x: 93.4, y: 122.5, z: 12, name: "陈迪", country: "Netherlands" }
                ]
            }, {
                name: "傅双育",
                data: [
                    { x: 85.4, y: 142.5, z: 12, name: "傅双育", country: "Netherlands" }
                ]
            }, {
                name: "刘旭阳",
                data: [
                    { x: 90.4, y: 112.5, z: 12, name: "刘旭阳", country: "Netherlands" }
                ]
            }, {
                name: "崔丹",
                data: [
                    { x: 100.4, y: 182.5, z: 12, name: "崔丹", country: "Netherlands" }
                ]
            }, {
                name: "俞旸",
                data: [
                    { x: 88.4, y: 156.5, z: 12, name: "俞旸", country: "Netherlands" }
                ]
            }, {
                name: "黄彩萍",
                data: [
                    { x: 90.4, y: 132.5, z: 12, name: "黄彩萍", country: "Netherlands" }
                ]
            }, {
                name: "张力甦",
                data: [
                    { x: 94.4, y: 202.5, z: 12, name: "张力甦", country: "Netherlands" }
                ]
            }]
        }]
    }, {
        id: 3,
        datas: [{
            id: 1,
            datas: [{
                name: "陈宏子",
                data: [
                    { x: 95, y: 95, z: 12, name: "陈宏子", country: "Belgium" }
                ]
            }, {
                name: "秦婷婷",
                data: [
                    { x: 86.5, y: 122.9, z: 12, name: "秦婷婷", country: "Germany" }
                ]
            }, {
                name: "折蓉蓉",
                data: [
                    { x: 85.8, y: 191.5, z: 12, name: "折蓉蓉", country: "Finland" }
                ]
            }, {
                name: "陈迪",
                data: [
                    { x: 88.4, y: 172.5, z: 12, name: "陈迪", country: "Netherlands" }
                ]
            }, {
                name: "傅双育",
                data: [
                    { x: 90.4, y: 152.5, z: 12, name: "傅双育", country: "Netherlands" }
                ]
            }, {
                name: "刘旭阳",
                data: [
                    { x: 130.4, y: 132.5, z: 12, name: "刘旭阳", country: "Netherlands" }
                ]
            }, {
                name: "崔丹",
                data: [
                    { x: 130.4, y: 182.5, z: 12, name: "崔丹", country: "Netherlands" }
                ]
            }, {
                name: "俞旸",
                data: [
                    { x: 160.4, y: 152.5, z: 12, name: "俞旸", country: "Netherlands" }
                ]
            }, {
                name: "黄彩萍",
                data: [
                    { x: 150.4, y: 102.5, z: 12, name: "黄彩萍", country: "Netherlands" }
                ]
            }, {
                name: "张力甦",
                data: [
                    { x: 170.4, y: 162.5, z: 12, name: "张力甦", country: "Netherlands" }
                ]
            }]
        }, {
            id: 2,
            datas: [{
                name: "陈宏子",
                data: [
                    { x: 96, y: 95, z: 12, name: "陈宏子", country: "Belgium" }
                ]
            }, {
                name: "秦婷婷",
                data: [
                    { x: 81.5, y: 192.9, z: 12, name: "秦婷婷", country: "Germany" }
                ]
            }, {
                name: "折蓉蓉",
                data: [
                    { x: 80.8, y: 91.5, z: 12, name: "折蓉蓉", country: "Finland" }
                ]
            }, {
                name: "陈迪",
                data: [
                    { x: 87.4, y: 102.5, z: 12, name: "陈迪", country: "Netherlands" }
                ]
            }, {
                name: "傅双育",
                data: [
                    { x: 80.4, y: 162.5, z: 12, name: "傅双育", country: "Netherlands" }
                ]
            }, {
                name: "刘旭阳",
                data: [
                    { x: 90.4, y: 122.5, z: 12, name: "刘旭阳", country: "Netherlands" }
                ]
            }, {
                name: "崔丹",
                data: [
                    { x: 70.4, y: 102.5, z: 12, name: "崔丹", country: "Netherlands" }
                ]
            }, {
                name: "俞旸",
                data: [
                    { x: 60.4, y: 112.5, z: 12, name: "俞旸", country: "Netherlands" }
                ]
            }, {
                name: "黄彩萍",
                data: [
                    { x: 86.4, y: 152.5, z: 12, name: "黄彩萍", country: "Netherlands" }
                ]
            }, {
                name: "张力甦",
                data: [
                    { x: 80.4, y: 142.5, z: 12, name: "张力甦", country: "Netherlands" }
                ]
            }]
        }, {
            id: 3,
            datas: [{
                name: "陈宏子",
                data: [
                    { x: 80, y: 95, z: 12, name: "陈宏子", country: "Belgium" }
                ]
            }, {
                name: "秦婷婷",
                data: [
                    { x: 86.5, y: 112.9, z: 12, name: "秦婷婷", country: "Germany" }
                ]
            }, {
                name: "折蓉蓉",
                data: [
                    { x: 90.8, y: 94.5, z: 12, name: "折蓉蓉", country: "Finland" }
                ]
            }, {
                name: "陈迪",
                data: [
                    { x: 88.4, y: 82.5, z: 12, name: "陈迪", country: "Netherlands" }
                ]
            }, {
                name: "傅双育",
                data: [
                    { x: 86.4, y: 152.5, z: 12, name: "傅双育", country: "Netherlands" }
                ]
            }, {
                name: "刘旭阳",
                data: [
                    { x: 75.4, y: 142.5, z: 12, name: "刘旭阳", country: "Netherlands" }
                ]
            }, {
                name: "崔丹",
                data: [
                    { x: 99.4, y: 152.5, z: 12, name: "崔丹", country: "Netherlands" }
                ]
            }, {
                name: "俞旸",
                data: [
                    { x: 80.4, y: 132.5, z: 12, name: "俞旸", country: "Netherlands" }
                ]
            }, {
                name: "黄彩萍",
                data: [
                    { x: 97.4, y: 92.5, z: 12, name: "黄彩萍", country: "Netherlands" }
                ]
            }, {
                name: "张力甦",
                data: [
                    { x: 99.4, y: 82.5, z: 12, name: "张力甦", country: "Netherlands" }
                ]
            }]
        }]
    }];
    return {
        get: function(serieId, monthid) {
            monthid += 1;
            for (var j = 0; j < series.length; j++) {
                if (series[j].id == monthid) {
                    for (var i = 0; i < series[j].datas.length; i++) {
                        if (series[j].datas[i].id == serieId) {
                            return series[j].datas[i].datas;
                        }
                    }
                }
            }
            return null;
        }
    };
}])


// 成员贡献
.factory('contribution', [function() {
    var performances = [{
        id: 0,
        datas: [{
            id: 0,
            data: [
                ['陈宏子', 8],
                ['秦婷婷', 10],
                ['折蓉蓉', 14],
                ['陈迪', 5],
                ['傅双育', 30],
                ['刘旭阳', 4],
                ['崔丹', 15],
                ['俞旸', 3],
                ['黄彩萍', 6],
                ['张力甦', 5]
            ]
        }, {
            id: 1,
            data: [
                ['陈宏子', 30],
                ['秦婷婷', 10],
                ['折蓉蓉', 5],
                ['陈迪', 14],
                ['傅双育', 6],
                ['刘旭阳', 4],
                ['崔丹', 10],
                ['俞旸', 5],
                ['黄彩萍', 11],
                ['张力甦', 5]
            ]
        }, {
            id: 2,
            data: [
                ['陈宏子', 2],
                ['秦婷婷', 10],
                ['折蓉蓉', 14],
                ['陈迪', 5],
                ['傅双育', 20],
                ['刘旭阳', 4],
                ['崔丹', 21],
                ['俞旸', 3],
                ['黄彩萍', 16],
                ['张力甦', 5]
            ]
        }]
    }, {
        id: 1,
        datas: [{
            id: 0,
            data: [
                ['陈宏子', 20],
                ['秦婷婷', 10],
                ['折蓉蓉', 4],
                ['陈迪', 15],
                ['傅双育', 18],
                ['刘旭阳', 4],
                ['崔丹', 17],
                ['俞旸', 1],
                ['黄彩萍', 1],
                ['张力甦', 10]
            ]
        }, {
            id: 1,
            data: [
                ['陈宏子', 8],
                ['秦婷婷', 10],
                ['折蓉蓉', 19],
                ['陈迪', 5],
                ['傅双育', 5],
                ['刘旭阳', 4],
                ['崔丹', 15],
                ['俞旸', 3],
                ['黄彩萍', 16],
                ['张力甦', 15]
            ]
        }, {
            id: 2,
            data: [
                ['陈宏子', 4],
                ['秦婷婷', 10],
                ['折蓉蓉', 14],
                ['陈迪', 32],
                ['傅双育', 3],
                ['刘旭阳', 4],
                ['崔丹', 15],
                ['俞旸', 3],
                ['黄彩萍', 10],
                ['张力甦', 5]
            ]
        }]
    }, {
        id: 2,
        datas: [{
            id: 0,
            data: [
                ['陈宏子', 8],
                ['秦婷婷', 10],
                ['折蓉蓉', 14],
                ['陈迪', 5],
                ['傅双育', 3],
                ['刘旭阳', 4],
                ['崔丹', 10],
                ['俞旸', 8],
                ['黄彩萍', 26],
                ['张力甦', 12]
            ]
        }, {
            id: 1,
            data: [
                ['陈宏子', 11],
                ['秦婷婷', 10],
                ['折蓉蓉', 14],
                ['陈迪', 5],
                ['傅双育', 27],
                ['刘旭阳', 4],
                ['崔丹', 10],
                ['俞旸', 8],
                ['黄彩萍', 6],
                ['张力甦', 5]
            ]
        }, {
            id: 2,
            data: [
                ['陈宏子', 1],
                ['秦婷婷', 17],
                ['折蓉蓉', 20],
                ['陈迪', 11],
                ['傅双育', 20],
                ['刘旭阳', 4],
                ['崔丹', 15],
                ['俞旸', 3],
                ['黄彩萍', 16],
                ['张力甦', 5]
            ]
        }]
    }];

    return {
        get: function(id, num) {
            for (var i = 0; i < performances.length; i++) {
                if (performances[i].id == id) {
                    for (var j = 0; j < performances[i].datas.length; j++) {
                        if (performances[i].datas[j].id == num) {
                            return performances[i].datas[j].data;

                        }
                    }
                }
            }
            return null;
        }
    };
}])

// 我的&Sales A
.factory('channels', [function() {
    var chans = [{
        id: 1,
        datas: [{
            name: 'Sales A',
            data: [{
                name: '医院',
                y: 45.62,
                color: '#7ACA17',
                quota: 89441,
                reach: 100
            }, {
                name: '药店',
                y: 26.33,
                color: '#1786CA',
                quota: 394102,
                reach: 100
            }, {
                name: '电商',
                y: 21.51,
                color: '#C6E42E',
                quota: 5944102,
                reach: 100
            }, {
                name: '其它',
                y: 6.54,
                color: '#DA4E3E',
                quota: 8944102,
                reach: 100
            }]
        }]
    }, {
        id: 2,
        datas: [{
            name: 'Sales A',
            data: [{
                name: '医院',
                y: 45.62,
                color: '#7ACA17',
                quota: 9944102,
                reach: 100
            }, {
                name: '药店',
                y: 22.33,
                color: '#1786CA',
                quota: 5944102,
                reach: 100
            }, {
                name: '电商',
                y: 18.51,
                color: '#C6E42E',
                quota: 3944102,
                reach: 100
            }, {
                name: '其它',
                y: 13.54,
                color: '#DA4E3E',
                quota: 1944102,
                reach: 100
            }]
        }]
    }, {
        id: 3,
        datas: [{
            name: 'Sales A',
            data: [{
                name: '医院',
                y: 15.62,
                color: '#7ACA17',
                quota: 5944102,
                reach: 100
            }, {
                name: '药店',
                y: 26.33,
                color: '#1786CA',
                quota: 6944102,
                reach: 100
            }, {
                name: '电商',
                y: 11.51,
                color: '#C6E42E',
                quota: 7944102,
                reach: 100
            }, {
                name: '其它',
                y: 46.54,
                color: '#DA4E3E',
                quota: 8944102,
                reach: 100
            }]
        }]
    }];

    return {
        get: function(id) {
            id += 1;
            for (var i = 0; i < chans.length; i++) {
                if (chans[i].id == id) {
                    return chans[i].datas;
                }
            }
            return null;
        }
    };
}])

.factory('ranks', [function() {
    var rank = [{
        id: 1,
        name: '舒痕 Dermatix',
        listOne: [{
            bid: '1',
            name: '舒痕 Dermatix',
            data: [{
                rank: 1,
                name: '陈宏子',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '李晓菲', post: 'MR', sales: 311, open: 10 },
                    { mRank: 2, name: '王梓涵', post: 'MR', sales: 114, open: 10 },
                    { mRank: 3, name: '陈美容', post: 'MR', sales: 218, open: 10 }
                ]
            }, {
                rank: 2,
                name: '秦婷婷',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '云传军', post: 'MR', sales: 321, open: 10 },
                    { mRank: 2, name: '李公明', post: 'MR', sales: 314, open: 10 },
                    { mRank: 3, name: '陈众议', post: 'MR', sales: 218, open: 10 }
                ]
            }, {
                rank: 3,
                name: '折蓉蓉',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '淳子', post: 'MR', sales: 251, open: 10 },
                    { mRank: 2, name: '陈远', post: 'MR', sales: 214, open: 10 },
                    { mRank: 3, name: '蔡天新', post: 'MR', sales: 338, open: 10 }
                ]
            }, {
                rank: 4,
                name: '陈迪',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '邬肖任', post: 'MR', sales: 251, open: 10 },
                    { mRank: 2, name: '程欢亭', post: 'MR', sales: 214, open: 10 },
                    { mRank: 3, name: '黎丙赣', post: 'MR', sales: 338, open: 10 }
                ]
            }, {
                rank: 5,
                name: '傅双育',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '刘勉励', post: 'MR', sales: 251, open: 10 },
                    { mRank: 2, name: '简务帅', post: 'MR', sales: 214, open: 10 },
                    { mRank: 3, name: '孙彩武', post: 'MR', sales: 338, open: 10 }
                ]
            }, {
                rank: 6,
                name: '刘旭阳',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '尤帅齐', post: 'MR', sales: 251, open: 10 },
                    { mRank: 2, name: '马仁毅', post: 'MR', sales: 214, open: 10 },
                    { mRank: 3, name: '康志强', post: 'MR', sales: 338, open: 10 }
                ]
            }, {
                rank: 7,
                name: '崔丹',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '李振云', post: 'MR', sales: 251, open: 10 },
                    { mRank: 2, name: '霍负浪', post: 'MR', sales: 214, open: 10 },
                    { mRank: 3, name: '陈仓翼', post: 'MR', sales: 338, open: 10 }
                ]
            }, {
                rank: 8,
                name: '俞旸',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '吴资龙', post: 'MR', sales: 251, open: 10 },
                    { mRank: 2, name: '岑刚飘', post: 'MR', sales: 214, open: 10 },
                    { mRank: 3, name: '郭山彤', post: 'MR', sales: 338, open: 10 }
                ]
            }, {
                rank: 9,
                name: '黄彩萍',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '李二明', post: 'MR', sales: 251, open: 10 },
                    { mRank: 2, name: '刘双正', post: 'MR', sales: 214, open: 10 },
                    { mRank: 3, name: '郭武莱', post: 'MR', sales: 338, open: 10 }
                ]
            }, {
                rank: 10,
                name: '张力甦',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '刘继牛', post: 'MR', sales: 251, open: 10 },
                    { mRank: 2, name: '刘东', post: 'MR', sales: 214, open: 10 },
                    { mRank: 3, name: '李海龙', post: 'MR', sales: 338, open: 10 }
                ]
            }]
        }, {
            bid: '2',
            name: '能气朗 Neuquinon',
            data: [{
                    rank: 1,
                    name: '陈宏子',
                    post: 'AM',
                    sales: 331,
                    open: 10,
                    datas: [
                        { mRank: 1, name: '却桢国', post: 'MR', sales: 631, open: 10 },
                        { mRank: 2, name: '张子健', post: 'MR', sales: 124, open: 10 },
                        { mRank: 3, name: '蔺安白', post: 'MR', sales: 218, open: 10 }
                    ]
                }, {
                    rank: 2,
                    name: '秦婷婷',
                    post: 'AM',
                    sales: 331,
                    open: 10,
                    datas: [
                        { mRank: 1, name: '曹旭', post: 'MR', sales: 321, open: 10 },
                        { mRank: 2, name: '程蝉', post: 'MR', sales: 534, open: 10 },
                        { mRank: 3, name: '崔卫平', post: 'MR', sales: 318, open: 10 }
                    ]
                }, {
                    rank: 3,
                    name: '折蓉蓉',
                    post: 'AM',
                    sales: 331,
                    open: 10,
                    datas: [
                        { mRank: 1, name: '蔡海山', post: 'MR', sales: 421, open: 10 },
                        { mRank: 2, name: '曹寇', post: 'MR', sales: 214, open: 10 },
                        { mRank: 3, name: '常远', post: 'MR', sales: 318, open: 10 }
                    ]
                }, {
                    rank: 4,
                    name: '陈迪',
                    post: 'AM',
                    sales: 331,
                    open: 10,
                    datas: [
                        { mRank: 1, name: '刘三正', post: 'MR', sales: 251, open: 10 },
                        { mRank: 2, name: '杜云', post: 'MR', sales: 214, open: 10 },
                        { mRank: 3, name: '石栓柱', post: 'MR', sales: 338, open: 10 }
                    ]
                }, {
                    rank: 5,
                    name: '傅双育',
                    post: 'AM',
                    sales: 331,
                    open: 10,
                    datas: [
                        { mRank: 1, name: '尚文忠', post: 'MR', sales: 251, open: 10 },
                        { mRank: 2, name: '张永强', post: 'MR', sales: 214, open: 10 },
                        { mRank: 3, name: '王禅', post: 'MR', sales: 338, open: 10 }
                    ]
                }, {
                    rank: 6,
                    name: '刘旭阳',
                    post: 'AM',
                    sales: 331,
                    open: 10,
                    datas: [
                        { mRank: 1, name: '康振清', post: 'MR', sales: 251, open: 10 },
                        { mRank: 2, name: '刘御', post: 'MR', sales: 214, open: 10 },
                        { mRank: 3, name: '高文军', post: 'MR', sales: 338, open: 10 }
                    ]
                }, {
                    rank: 7,
                    name: '崔丹',
                    post: 'AM',
                    sales: 331,
                    open: 10,
                    datas: [
                        { mRank: 1, name: '石胜厚', post: 'MR', sales: 251, open: 10 },
                        { mRank: 2, name: '石飞鹏', post: 'MR', sales: 214, open: 10 },
                        { mRank: 3, name: '高建明', post: 'MR', sales: 338, open: 10 }
                    ]
                }, {
                    rank: 8,
                    name: '俞旸',
                    post: 'AM',
                    sales: 331,
                    open: 10,
                    datas: [
                        { mRank: 1, name: '高文利', post: 'MR', sales: 251, open: 10 },
                        { mRank: 2, name: '张海宝', post: 'MR', sales: 214, open: 10 },
                        { mRank: 3, name: '孙瑞军', post: 'MR', sales: 338, open: 10 }
                    ]
                }, {
                    rank: 9,
                    name: '黄彩萍',
                    post: 'AM',
                    sales: 331,
                    open: 10,
                    datas: [
                        { mRank: 1, name: '王焕锁', post: 'MR', sales: 251, open: 10 },
                        { mRank: 2, name: '刘文明', post: 'MR', sales: 214, open: 10 },
                        { mRank: 3, name: '杜元晓', post: 'MR', sales: 338, open: 10 }
                    ]
                }, {
                    rank: 10,
                    name: '张力甦',
                    post: 'AM',
                    sales: 331,
                    open: 10,
                    datas: [
                        { mRank: 1, name: '刘海欢', post: 'MR', sales: 251, open: 10 },
                        { mRank: 2, name: '李金云', post: 'MR', sales: 214, open: 10 },
                        { mRank: 3, name: '贾六', post: 'MR', sales: 338, open: 10 }
                    ]
                }

            ]
        }]
    }, {
        id: 2,
        name: '能气朗 Neuquinon',
        listOne: [{
            bid: '1',
            name: '柏西 Espumisan',
            data: [{
                rank: 1,
                name: '陈宏子',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '曹天予', post: 'MR', sales: 531, open: 10 },
                    { mRank: 2, name: '曹征路', post: 'MR', sales: 384, open: 10 },
                    { mRank: 3, name: '陈绍华', post: 'MR', sales: 138, open: 10 }
                ]
            }, {
                rank: 2,
                name: '秦婷婷',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '陈浩', post: 'MR', sales: 151, open: 10 },
                    { mRank: 2, name: '蔡伟', post: 'MR', sales: 384, open: 10 },
                    { mRank: 3, name: '陈帆', post: 'MR', sales: 138, open: 10 }
                ]
            }, {
                rank: 3,
                name: '折蓉蓉',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '慈林', post: 'MR', sales: 211, open: 10 },
                    { mRank: 2, name: ' 蔡澜', post: 'MR', sales: 124, open: 10 },
                    { mRank: 3, name: '程万军', post: 'MR', sales: 428, open: 10 }
                ]
            }, {
                rank: 4,
                name: '陈迪',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '王志宏', post: 'MR', sales: 251, open: 10 },
                    { mRank: 2, name: '刘占宽', post: 'MR', sales: 214, open: 10 },
                    { mRank: 3, name: '王有罕', post: 'MR', sales: 338, open: 10 }
                ]
            }, {
                rank: 5,
                name: '傅双育',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '高二媛', post: 'MR', sales: 251, open: 10 },
                    { mRank: 2, name: '杜永强', post: 'MR', sales: 214, open: 10 },
                    { mRank: 3, name: '石根厚', post: 'MR', sales: 338, open: 10 }
                ]
            }, {
                rank: 6,
                name: '刘旭阳',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '王桂香', post: 'MR', sales: 251, open: 10 },
                    { mRank: 2, name: '申根换', post: 'MR', sales: 214, open: 10 },
                    { mRank: 3, name: '马占云', post: 'MR', sales: 338, open: 10 }
                ]
            }, {
                rank: 7,
                name: '崔丹',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '李二美', post: 'MR', sales: 251, open: 10 },
                    { mRank: 2, name: '刘龙', post: 'MR', sales: 214, open: 10 },
                    { mRank: 3, name: '杨万富', post: 'MR', sales: 338, open: 10 }
                ]
            }, {
                rank: 8,
                name: '俞旸',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '马祥', post: 'MR', sales: 251, open: 10 },
                    { mRank: 2, name: '石双厚', post: 'MR', sales: 214, open: 10 },
                    { mRank: 3, name: '刘埃生', post: 'MR', sales: 338, open: 10 }
                ]
            }, {
                rank: 9,
                name: '黄彩萍',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '王璐', post: 'MR', sales: 251, open: 10 },
                    { mRank: 2, name: '刘再海', post: 'MR', sales: 214, open: 10 },
                    { mRank: 3, name: '贾永世', post: 'MR', sales: 338, open: 10 }
                ]
            }, {
                rank: 10,
                name: '张力甦',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '张亮', post: 'MR', sales: 251, open: 10 },
                    { mRank: 2, name: '贾飞世', post: 'MR', sales: 214, open: 10 },
                    { mRank: 3, name: '董三女', post: 'MR', sales: 338, open: 10 }
                ]
            }]
        }, {
            bid: '2',
            name: '优泽 Ezerra',
            data: [{
                rank: 1,
                name: '陈宏子',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '崔岱远', post: 'MR', sales: 131, open: 10 },
                    { mRank: 2, name: '邓程', post: 'MR', sales: 124, open: 10 },
                    { mRank: 3, name: '杜欣', post: 'MR', sales: 248, open: 10 }
                ]
            }, {
                rank: 2,
                name: '秦婷婷',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '戴鹏飞', post: 'MR', sales: 121, open: 10 },
                    { mRank: 2, name: '贾飞世', post: 'MR', sales: 384, open: 10 },
                    { mRank: 3, name: '张虎豹', post: 'MR', sales: 218, open: 10 }
                ]
            }, {
                rank: 3,
                name: '折蓉蓉',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '孙立军', post: 'MR', sales: 51, open: 10 },
                    { mRank: 2, name: '王树林', post: 'MR', sales: 384, open: 10 },
                    { mRank: 3, name: '李熙平', post: 'MR', sales: 258, open: 10 }
                ]
            }, {
                rank: 4,
                name: '陈迪',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '丁冬芹', post: 'MR', sales: 251, open: 10 },
                    { mRank: 2, name: '王银喜', post: 'MR', sales: 214, open: 10 },
                    { mRank: 3, name: '陈桂平', post: 'MR', sales: 338, open: 10 }
                ]
            }, {
                rank: 5,
                name: '傅双育',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '孙丽萍', post: 'MR', sales: 251, open: 10 },
                    { mRank: 2, name: '王飞云', post: 'MR', sales: 214, open: 10 },
                    { mRank: 3, name: '郝埃连', post: 'MR', sales: 338, open: 10 }
                ]
            }, {
                rank: 6,
                name: '刘旭阳',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '孙成红', post: 'MR', sales: 251, open: 10 },
                    { mRank: 2, name: '王利祥', post: 'MR', sales: 214, open: 10 },
                    { mRank: 3, name: '韩刚龙', post: 'MR', sales: 338, open: 10 }
                ]
            }, {
                rank: 7,
                name: '崔丹',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '刘润生', post: 'MR', sales: 251, open: 10 },
                    { mRank: 2, name: '王越建', post: 'MR', sales: 214, open: 10 },
                    { mRank: 3, name: '杨海清', post: 'MR', sales: 338, open: 10 }
                ]
            }, {
                rank: 8,
                name: '俞旸',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '刘满贵', post: 'MR', sales: 251, open: 10 },
                    { mRank: 2, name: '杜喜喜', post: 'MR', sales: 214, open: 10 },
                    { mRank: 3, name: '杨平', post: 'MR', sales: 338, open: 10 }
                ]
            }, {
                rank: 9,
                name: '黄彩萍',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '折为成', post: 'MR', sales: 251, open: 10 },
                    { mRank: 2, name: '尚文清', post: 'MR', sales: 214, open: 10 },
                    { mRank: 3, name: '訾存贵', post: 'MR', sales: 338, open: 10 }
                ]
            }, {
                rank: 10,
                name: '张力甦',
                post: 'AM',
                sales: 331,
                open: 10,
                datas: [
                    { mRank: 1, name: '申换换', post: 'MR', sales: 251, open: 10 },
                    { mRank: 2, name: '石玉兰', post: 'MR', sales: 214, open: 10 },
                    { mRank: 3, name: '白莲女', post: 'MR', sales: 338, open: 10 }
                ]
            }]
        }]
    }];

    return {
        // 传进来下表
        get: function(id, bid) {
            var data;
            //当只传进来 id 表示用户点击的是 第一列
            if (!bid && bid != 0) {
                data = {
                    one: rank,
                    two: rank[id]
                };
            } else {
                data = rank[id].listOne[bid].data;
            }
            return data;
        }
    };
}])

// 销量趋势数据
.factory('salesSeries', [function() {
    var salesSeries = [{
        id: 1,
        datas: [{
            id: 1,
            datas: [{
                name: "陈宏子",
                data: [9042, 9999, 9999, 8888, 7777, 9999, 12000]
            }, {
                name: "秦婷婷",
                data: [8046, 8888, 8888, 7777, 6666, 8888, 11000]
            }, {
                name: "折蓉蓉",
                data: [7632, 7777, 7777, 6666, 5555, 7777, 10000]
            }, {
                name: "陈迪",
                data: [6383, 6666, 6666, 5555, 4444, 6666, 9999]
            }, {
                name: "傅双育",
                data: [5424, 5555, 5555, 4444, 3333, 5555, 8888]
            }, {
                name: "刘旭阳",
                data: [4432, 4444, 4444, 3333, 2222, 4444, 7777]
            }, {
                name: "崔丹",
                data: [3481, 3333, 3333, 2222, 1111, 3333, 6666]
            }, {
                name: "俞旸",
                data: [2024, 2222, 2222, 1111, 999, 2222, 5555]
            }, {
                name: "黄彩萍",
                data: [1254, 1111, 1111, 1000, 888, 1111, 4444]
            }, {
                name: "张力甦",
                data: [914, 999, 1000, 999, 777, 999, 3333]
            }]
        }, {
            id: 2,
            datas: [{
                name: "陈宏子",
                data: [9042, 8635, 9999, 11111, 7777, 9999, 12000]
            }, {
                name: "秦婷婷",
                data: [8046, 7107, 8888, 10000, 6666, 8888, 11000]
            }, {
                name: "折蓉蓉",
                data: [7632, 6203, 7777, 9999, 5555, 7777, 10000]
            }, {
                name: "陈迪",
                data: [6383, 5831, 6666, 5555, 4444, 6666, 9999]
            }, {
                name: "傅双育",
                data: [5424, 4031, 5555, 4444, 3333, 5555, 8888]
            }, {
                name: "刘旭阳",
                data: [4432, 3683, 4444, 3333, 2222, 4444, 7777]
            }, {
                name: "崔丹",
                data: [3481, 2962, 3333, 2222, 1111, 3333, 6666]
            }, {
                name: "俞旸",
                data: [2024, 1000, 2222, 1111, 999, 2222, 5555]
            }, {
                name: "黄彩萍",
                data: [1254, 990, 1111, 999, 888, 1111, 4444]
            }, {
                name: "张力甦",
                data: [914, 980, 999, 888, 777, 999, 3333]
            }]
        }]
    }, {
        id: 2,
        datas: [{
            id: 1,
            datas: [{
                name: "陈宏子",
                data: [9042, 8635, 9999, 8888, 11111, 9999, 12000]
            }, {
                name: "秦婷婷",
                data: [8046, 7107, 8888, 7777, 10000, 8888, 11000]
            }, {
                name: "折蓉蓉",
                data: [7632, 6203, 7777, 6666, 9999, 7777, 10000]
            }, {
                name: "陈迪",
                data: [6383, 5831, 6666, 5555, 8888, 6666, 9999]
            }, {
                name: "傅双育",
                data: [5424, 4031, 5555, 4444, 7777, 5555, 8888]
            }, {
                name: "刘旭阳",
                data: [4432, 3683, 4444, 3333, 6666, 4444, 7777]
            }, {
                name: "崔丹",
                data: [3481, 2962, 3333, 2222, 5555, 3333, 6666]
            }, {
                name: "俞旸",
                data: [2024, 1000, 2222, 1111, 4444, 2222, 5555]
            }, {
                name: "黄彩萍",
                data: [1254, 990, 1111, 999, 3333, 1111, 4444]
            }, {
                name: "张力甦",
                data: [914, 980, 999, 888, 2222, 999, 3333]
            }]
        }, {
            id: 2,
            datas: [{
                name: "陈宏子",
                data: [9042, 8635, 9999, 8888, 9999, 11111, 12000]
            }, {
                name: "秦婷婷",
                data: [8046, 7107, 8888, 7777, 8888, 10000, 11000]
            }, {
                name: "折蓉蓉",
                data: [7632, 6203, 7777, 6666, 7777, 9999, 10000]
            }, {
                name: "陈迪",
                data: [6383, 5831, 6666, 5555, 6666, 8888, 9999]
            }, {
                name: "傅双育",
                data: [5424, 4031, 5555, 4444, 5555, 7777, 8888]
            }, {
                name: "刘旭阳",
                data: [4432, 3683, 4444, 3333, 4444, 6666, 7777]
            }, {
                name: "崔丹",
                data: [3481, 2962, 3333, 2222, 3333, 5555, 6666]
            }, {
                name: "俞旸",
                data: [2024, 1000, 2222, 1111, 2222, 4444, 5555]
            }, {
                name: "黄彩萍",
                data: [1254, 990, 1111, 999, 1111, 3333, 4444]
            }, {
                name: "张力甦",
                data: [914, 980, 999, 888, 1000, 2222, 3333]
            }]
        }]
    }, {
        id: 3,
        datas: [{
            id: 1,
            datas: [{
                name: "陈宏子",
                data: [9042, 8635, 9999, 8888, 9999, 12000, 14000]
            }, {
                name: "秦婷婷",
                data: [8046, 7107, 8888, 7777, 8888, 11000, 13000]
            }, {
                name: "折蓉蓉",
                data: [7632, 6203, 7777, 6666, 7777, 10000, 12000]
            }, {
                name: "陈迪",
                data: [6383, 5831, 6666, 5555, 6666, 9999, 11111]
            }, {
                name: "傅双育",
                data: [5424, 4031, 5555, 4444, 5555, 8888, 10000]
            }, {
                name: "刘旭阳",
                data: [4432, 3683, 4444, 3333, 4444, 7777, 9999]
            }, {
                name: "崔丹",
                data: [3481, 2962, 3333, 2222, 3333, 6666, 8888]
            }, {
                name: "俞旸",
                data: [2024, 1000, 2222, 1111, 2222, 5555, 7777]
            }, {
                name: "黄彩萍",
                data: [1254, 990, 1111, 999, 1111, 4444, 6666]
            }, {
                name: "张力甦",
                data: [914, 980, 999, 888, 999, 3333, 5555]
            }]
        }, {
            id: 2,
            datas: [{
                name: "陈宏子",
                data: [9042, 8635, 9999, 8888, 7777, 9999, 10000]
            }, {
                name: "秦婷婷",
                data: [8046, 7107, 8888, 7777, 6666, 8888, 9999]
            }, {
                name: "折蓉蓉",
                data: [7632, 6203, 7777, 6666, 5555, 7777, 8888]
            }, {
                name: "陈迪",
                data: [6383, 5831, 6666, 5555, 4444, 6666, 7777]
            }, {
                name: "傅双育",
                data: [5424, 4031, 5555, 4444, 3333, 5555, 6666]
            }, {
                name: "刘旭阳",
                data: [4432, 3683, 4444, 3333, 2222, 4444, 5555]
            }, {
                name: "崔丹",
                data: [3481, 2962, 3333, 2222, 1111, 3333, 4444]
            }, {
                name: "俞旸",
                data: [2024, 1000, 2222, 1111, 999, 2222, 3333]
            }, {
                name: "黄彩萍",
                data: [1254, 990, 1111, 999, 888, 1111, 2222]
            }, {
                name: "张力甦",
                data: [914, 980, 999, 888, 777, 999, 1111]
            }]
        }]
    }];
    return {
        get: function(serieId, monthid) {
            monthid += 1;
            for (var j = 0; j < salesSeries.length; j++) {
                if (salesSeries[j].id == monthid) {
                    for (var i = 0; i < salesSeries[j].datas.length; i++) {
                        if (salesSeries[j].datas[i].id == serieId) {
                            return salesSeries[j].datas[i].datas;
                        }
                    }
                }
            }
            return null;
        }
    };
}]);
